import java.util.Random;
import java.util.Scanner;

public class text_4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int num = random.nextInt(101);//[0,101)
        while (true) {
            System.out.println("请输入你猜的数");
            int num1 = scanner.nextInt();
            if (num1 > num) {
                System.out.println("你猜的数太大了");
            } else if (num1 == num) {
                System.out.println("恭喜你，猜对了");
                break;
            } else {
                System.out.println("你猜的数太小了");
            }
        }
    }
}
